package com.qaml.mes.device.api;

import com.alibaba.fastjson.JSONObject;
import com.qaml.mes.device.config.FeignClientEncoder;
import com.qaml.mes.device.constant.GlobalConstant;
import com.qaml.mes.device.dto.eqp.OrgIDReqDTO;
import com.qaml.mes.device.dto.eqp.OrgUserReqDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @ClassName RbacClient
 * @Description 用户权限
 * @Author leikai
 * @Date 2024/3/7 0007 9:32
 * @Version 1.0
 */
@Component
@FeignClient(value = "rbac", configuration = {FeignClientEncoder.class})
public interface RbacClient {

    /**
     * @param accessToken
     * @param orgIDReqDTO
     * @return
     */
    @RequestMapping(value = "/rbac/org/detail", method = RequestMethod.POST)
    JSONObject orgDetail(@RequestHeader(name = GlobalConstant.ACCESS_TOKEN) String accessToken, @RequestBody OrgIDReqDTO orgIDReqDTO);

    @RequestMapping(value = "/rbac/org/user", method = RequestMethod.POST)
    JSONObject orgUser(@RequestHeader(name = GlobalConstant.ACCESS_TOKEN) String accessToken, @RequestBody OrgUserReqDTO orgUserReqDTO);
}